import { createStore, applyMiddleware } from 'redux'
import Reducers from '../Reducers'
import logger from "redux-logger";
import thunk from "redux-thunk"
import createSagaMiddleware from 'redux-saga'
import { composeWithDevTools } from 'redux-devtools-extension';
import mySaga from "./mySaga"

//创建中间件
const saga = createSagaMiddleware()
    // const store = createStore(Reducers, {}, composeWithDevTools(applyMiddleware(logger, thunk)));
const store = createStore(Reducers, {}, composeWithDevTools(applyMiddleware(saga)));
//将自定义的异步操作启动起来
saga.run(mySaga)

export default store